package com.rhb.af.business;

import java.util.List;

import com.rhb.af.bean.BaseQuery;
import com.rhb.af.bean.Page;
import com.rhb.af.dao.GeneralDAO;

public class FindBusiness_Impl implements FindBusiness {

	private GeneralDAO generalDAO;
	
	public GeneralDAO getGeneralDAO() {
		return generalDAO;
	}

	public void setGeneralDAO(GeneralDAO generalDAO) {
		this.generalDAO = generalDAO;
	}

	public Object findByPK(Class clazz, String pk){
		return (Object) this.generalDAO.findByPK(clazz, pk);
	}

	public Page findByQuery(BaseQuery query){
		int allCount = this.generalDAO.countByQuery(query);
		List list = this.generalDAO.findByQuery(query);
		Page page = new Page(allCount,query.getStart(),query.getCount(),list);
		return page;
	}
}
